<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	import="java.util.Enumeration,java.net.URLEncoder"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";

	String paramsString = "";
	Enumeration paramNames = (Enumeration) request.getParameterNames();
	while (paramNames.hasMoreElements()) {
		String name = (String) paramNames.nextElement();
		if (name.indexOf("pager.") != -1) {
			continue;
		}

		String[] values = request.getParameterValues(name);
		if (values.length == 1) {
			paramsString = paramsString + "&" + name + "=" + URLEncoder.encode(values[0], "utf-8");
		} else if (values.length > 1) {
			for (String value : values) {
				paramsString = paramsString + "&" + name + "=" + URLEncoder.encode(value, "utf-8");
			}
		}
	}
	request.setAttribute("paramsString", paramsString);
%>
<style type="text/css">
.goodsDiv {
	positon: relative;
	width: 100px;
	height: 30px;
	border: 1px;
}
</style>
<div class="m_top_10">
	<ul class="page">
		<pg:pager items="${pager.totalPageCount}" url="${pageUrl}"
			maxPageItems="1" export="currentPageNumber=pageNumber">
			<pg:index>
				<pg:first>
					<li><a href="${pageUrl}${paramsString}"><nobr>&nbsp;[首页]</nobr>
					</a></li>
				</pg:first>
				<pg:prev>
					<li><a href="${pageUrl}${paramsString}">前一页</a></li>
				</pg:prev>
				<pg:pages>
					<c:choose>
						<c:when test="${currentPageNumber eq pageNumber}">
							<!-- <font color="red">${pageNumber}</font>  -->
							<li><a class="hover" href="${pageUrl}${paramsString}">${pageNumber}
							</a></li>
						</c:when>
						<c:otherwise>
							<li><a href="${pageUrl}${paramsString}">${pageNumber}</a></li>
						</c:otherwise>
					</c:choose>
				</pg:pages>
				<pg:next>
					<li><a href="${pageUrl}${paramsString}">下一页</a></li>
				</pg:next>
				<pg:last>
					<li><a href="${pageUrl}${paramsString}"><nobr>[尾页]</nobr>
					</a></li>
				</pg:last>
			</pg:index>
		</pg:pager>
		<li class="page_tip"><span>记录总数：${pager.totalSize}&nbsp;&nbsp;总页数：${pager.totalPageCount}</span>
		</li>
	</ul>
</div>

